package com.njwb.day02;

import java.util.Scanner;

public class Test03 {
    public static void main(String[] args) {
        //根据给定的月份，使用if结构和switch结构 输出对应的季节
        System.out.println("请输入一个1~12的月份：");
        Scanner sc=new Scanner(System.in);
        int month=sc.nextInt();
        /*if(month==3||month==4||month==5){
            System.out.println(month+"月是春天");
        }else if (month==6||month==7||month==8){
            System.out.println(month+"月是夏天");
        }else if (month==9||month==10||month==11){
            System.out.println(month+"月是秋天");
        }else if (month==12||month==1||month==2){
            System.out.println(month+"月是冬天");
        }else{
            System.out.println("你输入的月份格式不对！");
        }*/

        switch (month){
            case 3:
            case 4:
            case 5: System.out.println(month+"月是春天");break;
            case 6:
            case 7:
            case 8: System.out.println(month+"月是夏天");break;
            case 9:
            case 10:
            case 11: System.out.println(month+"月是秋天");break;
            case 12:
            case 1:
            case 2: System.out.println(month+"月是冬天");break;
            default: System.out.println("你输入的月份格式不对！");break;
        }



    }
}
